package main.java.com.example;

import java.util.Vector;
/**
 * @description:    只要看看MyStack类，就会发现
 * 用户只要它做4件事：
 *  1、push()
 *  2、pop()
 *  3、size()
 *  4、isEmpty()
 * @author:         cong zhi
 * @createDate:     2022/6/20 8:25
 * @updateUser:     cong zhi
 * @updateDate:     2022/6/20 8:25
 * @updateRemark:   修改内容
 * @version:        v1.0
 */
public class MyStack extends Vector {

    public void push(Object element) {
        insertElementAt(element, 0);
    }

    public Object pop() {
        Object result = firstElement();
        removeElementAt(0);
        return result;
    }
}
